package com.androidx.p013lv.invention.adapter;

import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.novel.LabelFictionData;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.invention.C1069R;
import java.util.List;

/* renamed from: com.androidx.lv.invention.adapter.AdapterFictionLabel */
public class AdapterFictionLabel extends BaseRecyclerAdapter<LabelFictionData, Holder> {
    String domain;
    private int mCount = 30;
    private boolean mIsShowOnlyCount;

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((LabelFictionData) this.list.get(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    public void setShowOnlyFour(boolean z) {
        setShowOnlyCount(z, this.mCount);
    }

    public void setShowOnlyCount(boolean z, int i) {
        this.mIsShowOnlyCount = z;
        this.mCount = i;
        notifyDataSetChanged();
    }

    @Override // com.androidx.p013lv.base.recycler.BaseRecyclerAdapter
    public void setData(List<LabelFictionData> list) {
        if (list != null) {
            this.list.clear();
            this.list.addAll(list);
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter, com.androidx.p013lv.base.recycler.BaseRecyclerAdapter
    public int getItemCount() {
        int i;
        return (!this.mIsShowOnlyCount || super.getItemCount() <= (i = this.mCount)) ? super.getItemCount() : i;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1069R.C1074layout.item_label, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.invention.adapter.AdapterFictionLabel$Holder */
    public class Holder extends BaseRecyclerHolder {
        TextView tv_label;

        public Holder(View view) {
            super(view);
            this.tv_label = (TextView) view.findViewById(C1069R.C1072id.tv_label);
        }

        public void setData(LabelFictionData labelFictionData, int i) {
            this.tv_label.setText(labelFictionData.getTitle());
            if (labelFictionData.getStatus() == 0) {
                this.tv_label.setTextColor(-1);
                this.tv_label.setBackgroundResource(C1069R.C1071drawable.shape_label_bg_unselect);
                return;
            }
            this.tv_label.setTextColor(Color.parseColor("#FFCEEF"));
            this.tv_label.setBackgroundResource(C1069R.C1071drawable.shape_fiction_label_select);
        }
    }
}
